import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/buy_sell_bean_entity.dart';

BuySellBeanEntity $BuySellBeanEntityFromJson(Map<String, dynamic> json) {
  final BuySellBeanEntity buySellBeanEntity = BuySellBeanEntity();
  final int? code = jsonConvert.convert<int>(json['Code']);
  if (code != null) {
    buySellBeanEntity.code = code;
  }
  final BuySellBeanData? data = jsonConvert.convert<BuySellBeanData>(
      json['Data']);
  if (data != null) {
    buySellBeanEntity.data = data;
  }
  final String? msg = jsonConvert.convert<String>(json['Msg']);
  if (msg != null) {
    buySellBeanEntity.msg = msg;
  }
  return buySellBeanEntity;
}

Map<String, dynamic> $BuySellBeanEntityToJson(BuySellBeanEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Code'] = entity.code;
  data['Data'] = entity.data.toJson();
  data['Msg'] = entity.msg;
  return data;
}

extension BuySellBeanEntityExtension on BuySellBeanEntity {
  BuySellBeanEntity copyWith({
    int? code,
    BuySellBeanData? data,
    String? msg,
  }) {
    return BuySellBeanEntity()
      ..code = code ?? this.code
      ..data = data ?? this.data
      ..msg = msg ?? this.msg;
  }
}

BuySellBeanData $BuySellBeanDataFromJson(Map<String, dynamic> json) {
  final BuySellBeanData buySellBeanData = BuySellBeanData();
  final int? id = jsonConvert.convert<int>(json['Id']);
  if (id != null) {
    buySellBeanData.id = id;
  }
  final String? teamId = jsonConvert.convert<String>(json['TeamId']);
  if (teamId != null) {
    buySellBeanData.teamId = teamId;
  }
  final String? creatorAccount = jsonConvert.convert<String>(
      json['CreatorAccount']);
  if (creatorAccount != null) {
    buySellBeanData.creatorAccount = creatorAccount;
  }
  final String? teamOwner = jsonConvert.convert<String>(json['TeamOwner']);
  if (teamOwner != null) {
    buySellBeanData.teamOwner = teamOwner;
  }
  final String? buyerCode = jsonConvert.convert<String>(json['BuyerCode']);
  if (buyerCode != null) {
    buySellBeanData.buyerCode = buyerCode;
  }
  final String? buyerAccount = jsonConvert.convert<String>(
      json['BuyerAccount']);
  if (buyerAccount != null) {
    buySellBeanData.buyerAccount = buyerAccount;
  }
  final String? sellerCode = jsonConvert.convert<String>(json['SellerCode']);
  if (sellerCode != null) {
    buySellBeanData.sellerCode = sellerCode;
  }
  final String? sellerAccount = jsonConvert.convert<String>(
      json['SellerAccount']);
  if (sellerAccount != null) {
    buySellBeanData.sellerAccount = sellerAccount;
  }
  final int? gameId = jsonConvert.convert<int>(json['GameId']);
  if (gameId != null) {
    buySellBeanData.gameId = gameId;
  }
  final String? gameName = jsonConvert.convert<String>(json['GameName']);
  if (gameName != null) {
    buySellBeanData.gameName = gameName;
  }
  final String? gameType = jsonConvert.convert<String>(json['GameType']);
  if (gameType != null) {
    buySellBeanData.gameType = gameType;
  }
  final String? teamType = jsonConvert.convert<String>(json['TeamType']);
  if (teamType != null) {
    buySellBeanData.teamType = teamType;
  }
  final String? teamName = jsonConvert.convert<String>(json['TeamName']);
  if (teamName != null) {
    buySellBeanData.teamName = teamName;
  }
  final String? compensationCode = jsonConvert.convert<String>(
      json['CompensationCode']);
  if (compensationCode != null) {
    buySellBeanData.compensationCode = compensationCode;
  }
  final String? compensationType = jsonConvert.convert<String>(
      json['CompensationType']);
  if (compensationType != null) {
    buySellBeanData.compensationType = compensationType;
  }
  final dynamic payee = json['Payee'];
  if (payee != null) {
    buySellBeanData.payee = payee;
  }
  final dynamic closingTime = json['ClosingTime'];
  if (closingTime != null) {
    buySellBeanData.closingTime = closingTime;
  }
  final int? dissolutionStatus = jsonConvert.convert<int>(
      json['DissolutionStatus']);
  if (dissolutionStatus != null) {
    buySellBeanData.dissolutionStatus = dissolutionStatus;
  }
  final dynamic dissolutionTime = json['DissolutionTime'];
  if (dissolutionTime != null) {
    buySellBeanData.dissolutionTime = dissolutionTime;
  }
  final int? orderId = jsonConvert.convert<int>(json['OrderId']);
  if (orderId != null) {
    buySellBeanData.orderId = orderId;
  }
  final String? orderTitle = jsonConvert.convert<String>(json['OrderTitle']);
  if (orderTitle != null) {
    buySellBeanData.orderTitle = orderTitle;
  }
  final int? orderChannelId = jsonConvert.convert<int>(json['OrderChannelId']);
  if (orderChannelId != null) {
    buySellBeanData.orderChannelId = orderChannelId;
  }
  final int? serialNumber = jsonConvert.convert<int>(json['SerialNumber']);
  if (serialNumber != null) {
    buySellBeanData.serialNumber = serialNumber;
  }
  final double? numberPrice = jsonConvert.convert<double>(json['NumberPrice']);
  if (numberPrice != null) {
    buySellBeanData.numberPrice = numberPrice;
  }
  final int? teamCreateDateTime = jsonConvert.convert<int>(
      json['TeamCreateDateTime']);
  if (teamCreateDateTime != null) {
    buySellBeanData.teamCreateDateTime = teamCreateDateTime;
  }
  final String? headPic = jsonConvert.convert<String>(json['HeadPic']);
  if (headPic != null) {
    buySellBeanData.headPic = headPic;
  }
  final String? addTime = jsonConvert.convert<String>(json['AddTime']);
  if (addTime != null) {
    buySellBeanData.addTime = addTime;
  }
  return buySellBeanData;
}

Map<String, dynamic> $BuySellBeanDataToJson(BuySellBeanData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['Id'] = entity.id;
  data['TeamId'] = entity.teamId;
  data['CreatorAccount'] = entity.creatorAccount;
  data['TeamOwner'] = entity.teamOwner;
  data['BuyerCode'] = entity.buyerCode;
  data['BuyerAccount'] = entity.buyerAccount;
  data['SellerCode'] = entity.sellerCode;
  data['SellerAccount'] = entity.sellerAccount;
  data['GameId'] = entity.gameId;
  data['GameName'] = entity.gameName;
  data['GameType'] = entity.gameType;
  data['TeamType'] = entity.teamType;
  data['TeamName'] = entity.teamName;
  data['CompensationCode'] = entity.compensationCode;
  data['CompensationType'] = entity.compensationType;
  data['Payee'] = entity.payee;
  data['ClosingTime'] = entity.closingTime;
  data['DissolutionStatus'] = entity.dissolutionStatus;
  data['DissolutionTime'] = entity.dissolutionTime;
  data['OrderId'] = entity.orderId;
  data['OrderTitle'] = entity.orderTitle;
  data['OrderChannelId'] = entity.orderChannelId;
  data['SerialNumber'] = entity.serialNumber;
  data['NumberPrice'] = entity.numberPrice;
  data['TeamCreateDateTime'] = entity.teamCreateDateTime;
  data['HeadPic'] = entity.headPic;
  data['AddTime'] = entity.addTime;
  return data;
}

extension BuySellBeanDataExtension on BuySellBeanData {
  BuySellBeanData copyWith({
    int? id,
    String? teamId,
    String? creatorAccount,
    String? teamOwner,
    String? buyerCode,
    String? buyerAccount,
    String? sellerCode,
    String? sellerAccount,
    int? gameId,
    String? gameName,
    String? gameType,
    String? teamType,
    String? teamName,
    String? compensationCode,
    String? compensationType,
    dynamic payee,
    dynamic closingTime,
    int? dissolutionStatus,
    dynamic dissolutionTime,
    int? orderId,
    String? orderTitle,
    int? orderChannelId,
    int? serialNumber,
    double? numberPrice,
    int? teamCreateDateTime,
    String? headPic,
    String? addTime,
  }) {
    return BuySellBeanData()
      ..id = id ?? this.id
      ..teamId = teamId ?? this.teamId
      ..creatorAccount = creatorAccount ?? this.creatorAccount
      ..teamOwner = teamOwner ?? this.teamOwner
      ..buyerCode = buyerCode ?? this.buyerCode
      ..buyerAccount = buyerAccount ?? this.buyerAccount
      ..sellerCode = sellerCode ?? this.sellerCode
      ..sellerAccount = sellerAccount ?? this.sellerAccount
      ..gameId = gameId ?? this.gameId
      ..gameName = gameName ?? this.gameName
      ..gameType = gameType ?? this.gameType
      ..teamType = teamType ?? this.teamType
      ..teamName = teamName ?? this.teamName
      ..compensationCode = compensationCode ?? this.compensationCode
      ..compensationType = compensationType ?? this.compensationType
      ..payee = payee ?? this.payee
      ..closingTime = closingTime ?? this.closingTime
      ..dissolutionStatus = dissolutionStatus ?? this.dissolutionStatus
      ..dissolutionTime = dissolutionTime ?? this.dissolutionTime
      ..orderId = orderId ?? this.orderId
      ..orderTitle = orderTitle ?? this.orderTitle
      ..orderChannelId = orderChannelId ?? this.orderChannelId
      ..serialNumber = serialNumber ?? this.serialNumber
      ..numberPrice = numberPrice ?? this.numberPrice
      ..teamCreateDateTime = teamCreateDateTime ?? this.teamCreateDateTime
      ..headPic = headPic ?? this.headPic
      ..addTime = addTime ?? this.addTime;
  }
}